import request from '@/config/axios'

export interface CorpConfigVO {
  id: number
  averageCallingDuration: number
  callingExpirationDuration: number
  manualCallingCount: number
  queueSetup: number
}

// 查询企业基础配置列表
export const getCorpConfigPage = async (params: CorpConfigPageReqVO) => {
  return await request.get({ url: `/queue/corp-config/page`, params })
}

// 查询企业基础配置精简
export const getCorpConfigNoauth = async () => {
  return await request.get({ url: `/queue/corp-config/get-corp-config-no-auth` })
}
// 查询企业基础配置详情
export const getCorpConfig = async (id: number) => {
  return await request.get({ url: `/queue/corp-config/get?id=` + id })
}

// 新增企业基础配置
export const createCorpConfig = async (data: CorpConfigVO) => {
  return await request.post({ url: `/queue/corp-config/create`, data })
}

// 修改企业基础配置
export const updateCorpConfig = async (data: CorpConfigVO) => {
  return await request.put({ url: `/queue/corp-config/update`, data })
}

// 删除企业基础配置
export const deleteCorpConfig = async (id: number) => {
  return await request.delete({ url: `/queue/corp-config/delete?id=` + id })
}

// 导出企业基础配置 Excel
export const exportCorpConfig = async (params) => {
  return await request.download({ url: `/queue/corp-config/export-excel`, params })
}
